package org.cx.oa.dao.impl;

import java.util.List;

import org.cx.oa.base.BaseDaoImpl;
import org.cx.oa.dao.CongfigCommunicationInfo;
import org.cx.oa.entity.CongfigCommunication;
import org.cx.oa.entity.Employee;
import org.cx.oa.entity.PersonalCommunication;
import org.cx.oa.util.BeanFactory;

public class CongfigCommunicationInfoImpl extends BaseDaoImpl<CongfigCommunication> implements CongfigCommunicationInfo<CongfigCommunication>  {

	@Override
	public void save(CongfigCommunication obj) {
		// TODO Auto-generated method stub
		super.save(obj);
	}

	@Override
	public void update(CongfigCommunication obj) {
		// TODO Auto-generated method stub
		super.update(obj);
	}

	@Override
	public void delete(CongfigCommunication obj) {
		// TODO Auto-generated method stub
		super.delete(obj);
	}

	@Override
	public List<CongfigCommunication> findAll() {
		// TODO Auto-generated method stub
		return super.findAll();
	}

	@Override
	public CongfigCommunication findById(int id) {
		// TODO Auto-generated method stub
		return super.findById(id);
	}

	@Override
	public List<CongfigCommunication> getByIdList(Integer[] idList) {
		// TODO Auto-generated method stub
		return super.getByIdList(idList);
	}
	
	public List<CongfigCommunication> selectCongfigC(int employeeId){
		
		@SuppressWarnings("unchecked")
		List<CongfigCommunication> list = getSession().createQuery("from "+BeanFactory.getImpl(CongfigCommunication.class).getClass().getName()+" where EmployeeId="+employeeId).list();
		return list;
	}
	
	public Employee getEmployee(int employeeId){
		
		Employee employee = (Employee) getSession().createQuery("from "+BeanFactory.getImpl(Employee.class).getClass().getName()+" where UserId="+employeeId);
		return employee;
	}
	
}
